/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ocumed.teams.teamb.gui;

import java.util.ArrayList;

import ocumed.teams.teamb.application.PatientReihung;

/**
 *
 * @author apr3455
 */
public class WarteschlangeArzt extends WarteschlangeModel {

    Integer m_arztId;
    
    public WarteschlangeArzt(PatientReihung controller, Integer arztId){
        super(controller);
        m_arztId = arztId;
        buildTable();
    }

    public Object getValueAt(int row, int col) {
        if(col < m_aerzteIds.size()){
            if(col == 0){
                return " " + String.valueOf(row + 1);
            } else {
                if(getPatientIdAt(row, col) != null){
                    return m_patientNames.get(getPatientIdAt(row, col));
                }
                return "";
           }
        }
        return null;
    }
    
    protected Integer getSelectedPatient(Integer row, Integer col){
        return getPatientIdAt(row, 1);
    }
    
    public int getColumnCount() {
        return m_aerzteIds.size();
    }
    
    public void initColumn(){
        m_columnName = new String[m_aerzteIds.size() + 1];
        m_columnName[0] = "Pos.";
    }
    
    public void initAerzte(){
        m_aerzteIds = new ArrayList<Integer>();
        m_aerzteIds.add(0, -1);
        if(m_arztId != null){
            m_aerzteIds.add(m_arztId);
        }
    }
    
    protected String getArztName(int arztId){
        return "Patienten in Warteschlange";
    }

    @Override
    protected void setRowCount() {
        m_rowCount = m_patientListe.size();
    }

}
